/*
 *  $Id: JogProviders.cs 1220 2010-11-30 16:25:44Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008-2010 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima {
    /// <summary>
    /// Jog-провайдер для маны игрока.
    /// </summary>
    public class ManaJogValueProvider : IJogValueProvider {
        private Player _player;
        private ElementType _element;
        private int _default, _minimum, _maximumDiff;

        public ManaJogValueProvider(Player player, ElementType element) : this(player, element, 1, 1, 0) {
        }
        public ManaJogValueProvider(Player player, ElementType element, int def, int min, int maxDiff) {
            _player = player;
            _element = element;
            _default = def;
            _minimum = min;
            _maximumDiff = maxDiff;
        }

        public int GetDefaultValue() {
            return _default;
        }

        public int GetMinValue() {
            return _minimum;
        }

        public int GetMaxValue() {
            return _player.GetMana(_element) + _maximumDiff;
        }
    }

    /// <summary>
    /// Jog-провайдер для карт игрока.
    /// </summary>
    public class CardJogValueProvider : IJogValueProvider {
        private Player _player;
        private int _default, _minimum, _maximumDiff;

        public CardJogValueProvider(Player player) : this(player, 1, 1, -1) {
        }
        public CardJogValueProvider(Player player, int def, int min, int maxDiff) {
            _player = player;
            _default = def;
            _minimum = min;
            _maximumDiff = maxDiff;
        }

        public int GetDefaultValue() {
            return _default;
        }

        public int GetMinValue() {
            return _minimum;
        }

        public int GetMaxValue() {
            return _player.Hands.Count + _maximumDiff;
        }
    }
}
